function render(json) {
    this.set("Content-Type", "application/json")
    this.body = JSON.stringify(json)
}

export default function () {
    return async (ctx, next) => {
        ctx.send = render.bind(ctx)
        await next()
    }
}